home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-25 | 2.5 KB | 95 lines | [TEXT/CWIE] |
- // ==================================================
- // CTouchMePref.h
- // Copyright (C) 1996-1997 Mizutori Tetsuya
- // July 4 ,1996; February 3, 1997; April 23, 1997.
- // ==================================================
- // All documents are pretty-printed in 10-point Geneva font.
-
- #pragma once
-
- #include "CPrefsFile.h"
-
-
- typedef enum {
- touchType_CreationDate = 0, // must start with 0
- touchType_ModificationDate,
- touchType_END
- } ETouchType;
-
-
- typedef enum {
- touchFlag_Current = 0, // must start with 0
- touchFlag_Direct,
- touchFlag_First,
- touchFlag_Second,
- touchFlag_Null,
- touchFlag_END // the number must be a multiles by 2
- } ETouchFlag;
-
-
- // This structure is same to that of resource type 'PREF'.
- typedef struct {
- Uint32 version;
- Rect wframe;
- Int16 sync;
- Int16 reserved_1; // for 4-byte alignment
- Int16 enabled[touchType_END]; // must be 4-byte multiples
- Int16 flag[touchType_END]; // must be 4-byte multiples
- Uint32 datetime[touchType_END];
- } SPrefsRec, *SPresfPtr, **SPrefsHandle;
-
- class LWindow;
-
- class CTouchMePref : public CPrefsFile {
-
- public:
- CTouchMePref();
- CTouchMePref( ConstStr255Param inFileName );
- virtual ~CTouchMePref();
-
- // Load prefs data from the Preferences file.
- OSErr LoadPrefsData( void );
-
- // Save prefs data to the Preferences file.
- OSErr SavePrefsData( void );
-
- // Set the window's settings by prefs data.
- void SetPrefsToWindow( LWindow * inWindow );
-
- // Get the window's settings to prefs data.
- void GetPrefsFromWindow( LWindow * inWindow );
-
- // Set and Get the settings data of the member 'XXX'
- void SetWindowRect( Rect & inWindowRect );
- void GetWindowRect( Rect & outWindowRect );
-
- void SetSync( const Boolean inStatus );
- Boolean GetSync( void );
-
- void SetEnabled( const ETouchType inType, const Boolean inStatus );
- Boolean GetEnabled( const ETouchType inType );
-
- void SetFlag( const ETouchType inType, const ETouchFlag inFlag, const Boolean inStatus );
- Boolean GetFlag( const ETouchType inType, const ETouchFlag inFlag );
-
- void SetFlagNumb( const ETouchType inType, const ETouchFlag inFlag );
- ETouchFlag GetFlagNumb( const ETouchType inType );
-
- void SetDateTime( const ETouchType inType, const unsigned long inValue );
- unsigned long GetDateTime( const ETouchType inType );
-
-
- private:
-
- void SetupConstants( void );
-
- // Transform preferences data to/from 'mPrefs' record.
- void TransformToSettings( void );
- void TransformFromSettings( void );
-
- // A working data structure for handling preferences file
- SPrefsRec mPrefs;
- };
-
- // end of definitions
-